/**
 * 功能:发票代码号码范围 Dao类
 * 开发人员:yaren
 * 创建时间:2012/4/21 22:45:40
 */
package com.towker.frame.dao.basicData;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.springframework.stereotype.Repository;
import com.towker.core.db.BaseDao;
import com.towker.frame.model.basicData.Departments;
import com.towker.frame.model.basicData.Invoices;

@Repository
@SuppressWarnings("unchecked")
public class InvoicesDao extends BaseDao<Invoices, Long>
{
	@Override
	public Class getEntityClass()
	{
		return Invoices.class;
	}

	public Invoices getByBillingCode(String billingCode) {
		String statementName = getIbatisMapperNamespace() + ".getByBillingCode";
		Map params = new TreeMap<String, Object>();
		params.put("billing_code", billingCode);
		List<Invoices> invoices = getSqlSessionTemplate().selectList(statementName, params);
		if (invoices.size() > 0) {
			return invoices.get(0);
		}
		return null;
	}
}